#include<stdio.h>
#include<stdlib.h>
typedef struct TreeNode {

	struct TreeNode* left;
	struct TreeNode* right;
	int val;


}BTNode;

BTNode* BuyTreeNode(int x)
{
	BTNode* temp = (BTNode*)malloc(sizeof(BTNode));
	if (temp == NULL)
	{
		perror("malloc:");
		return -1;
	}
	temp->left = NULL;
	temp->right = NULL;
	temp->val = x;
	return temp;

}
void TreeNodeInit(BTNode* BT)
{
	BT->left = NULL;
	BT->right = NULL;
	BT->val = 0;


}
void InOrder(BTNode* BT)
{
	if (BT== NULL)
	{
		printf("NULL");
		return;
	}
	printf("%d ", BT->val);
	InOrder(BT->left);
	InOrder(BT->right);


}

int main()
{
	
	BTNode* node1 = BuyTreeNode(1);
	
	BTNode* node2 = BuyTreeNode(2);
	
	BTNode* node3 = BuyTreeNode(3);
	
	BTNode* node4 = BuyTreeNode(4);
	
	BTNode* node5 = BuyTreeNode(5);
	
	BTNode* node6 = BuyTreeNode(6);
	
	node1->left = node2;
	node1->right = node4;
	node2->left = node3;
	node4->left = node5;
	node5->right = node6;
	InOrder(node1);
	

	return 0;

}